<template>
    <div>
        <div class="mui-numbox" data-numbox-min='0'>
            <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
            <input class="mui-numbox-input" type="number" :value="initCount" ref="numbox" @change="countChanged"/>
            <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
        </div>  
    </div>
</template>

<script>
import mui from '../../lib/mui/js/mui.js'
export default {
    mounted() {
        mui(".mui-numbox").numbox();
    },
    methods:{
        countChanged(){
            this.$store.commit('updateGoodsInfo',{
                id:this.goodsid,
                count:this.$refs.numbox.value
            })
        }
    },
    props:['initCount','goodsid']
}
</script>

<style lang="scss" scoped>
    
</style>